﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DDD4Fun.Mediator
{
    public class Class2
    {
        public Class2()
        {
            MessageMediator.Instance.Register<string>(this, (e) => {
                Console.WriteLine(string.Format("class2 receive:{0}", e));
            });
        }

        public void go()
        {
            MessageMediator.Instance.Send<string>("send by class2");
            MessageMediator.Instance.Send<string,Class1>("send by class2 to Class1");
        }
    }
}
